- visibility_level = params.dig(:project, :visibility_level) || default_project_visibility
- ci_cd_only = local_assigns.fetch(:ci_cd_only, false)
- hide_init_with_readme = local_assigns.fetch(:hide_init_with_readme, false)

.row{ id: project_name_id }
  = f.hidden_field :ci_cd_only, value: ci_cd_only
  .form-group.project-name.col-sm-12
    = f.label :name, class: 'label-bold' do
      %span= _("Project name")
    = f.text_field :name, placeholder: "My awesome project", class: "form-control input-lg", autofocus: true, required: true
  .form-group.project-path.col-sm-6
    = f.label :namespace_id, class: 'label-bold' do
      %span= s_("Project URL")
    .input-group
      - if current_user.can_select_namespace?
        .input-group-prepend.has-tooltip{ title: root_url }
          .input-group-text
            = root_url
        - namespace_id = namespace_id_from(params)
        = f.select(:namespace_id,
                   namespaces_options(namespace_id || :current_user,
                                      display_path: true,
                                      extra_group: namespace_id),
                   {},
                   { class: 'select2 js-select-namespace qa-project-namespace-select', tabindex: 1})

      - else
        .input-group-prepend.static-namespace.has-tooltip{ title: user_url(current_user.username) + '/' }
          .input-group-text.border-0
            #{user_url(current_user.username)}/
        = f.hidden_field :namespace_id, value: current_user.namespace_id
  .form-group.project-path.col-sm-6
    = f.label :path, class: 'label-bold' do
      %span= _("Project slug")
    = f.text_field :path, placeholder: "my-awesome-project", class: "form-control", tabindex: 2, required: true
- if current_user.can_create_group?
  .form-text.text-muted
    Want to house several dependent projects under the same namespace?
    = link_to "Create a group.", new_group_path

.form-group
  = f.label :description, class: 'label-bold' do
    Project description
    %span (optional)
  = f.text_area :description, placeholder: 'Description format',  class: "form-control", rows: 3, maxlength: 250

= f.label :visibility_level, class: 'label-bold' do
  Visibility Level
  = link_to icon('question-circle'), help_page_path("public_access/public_access"), aria: { label: 'Documentation for Visibility Level' }, target: '_blank', rel: 'noopener noreferrer'
= render 'shared/visibility_level', f: f, visibility_level: visibility_level.to_i, can_change_visibility_level: true, form_model: @project, with_label: false

- if !hide_init_with_readme
  .form-group.row.initialize-with-readme-setting
    %div{ :class => "col-sm-12" }
      .form-check
        = check_box_tag 'project[initialize_with_readme]', '1', false, class: 'form-check-input'
        = label_tag 'project[initialize_with_readme]', class: 'form-check-label' do
          .option-title
            %strong Initialize repository with a README
          .option-description
            Allows you to immediately clone this project’s repository. Skip this if you plan to push up an existing repository.

= f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4
= link_to 'Cancel', dashboard_projects_path, class: 'btn btn-cancel'
